var renderDivVar;

var reportGetDataObj = {
	getReportData : function(reportType,renderDiv) {
		renderDivVar = renderDiv;
		var handler;
		switch (reportType) {
			case 'contactStatus':
				handler = 'getDataReportContactStatus';
				break;
			case 'callsByStaffMember':
				handler = 'getDataReportCallsStaffMember';
				break;
			default:
				handler = 'getDataReportContactStatus';
		}
		
		var params = 'handler='+handler;
		var ajaxResults = new Ajax.Request('ajaxDirector.php', {
			method: 'POST',
			parameters: params,
			onSuccess: function(transport) {
				reportRenderChartsObj.renderChart(transport.responseText);
			},
			onFailure: function() {
				alert('Oops!');
			}	
		});
	}
}

var reportRenderChartsObj = {
	renderChart : function(graphImageString) {
		$(renderDivVar).innerHTML = graphImageString;
		
		/*
		var jsonObject = eval('(' + jsonString + ')');
		var totalData  = (jsonObject.DataPoints.length)-1;
		var chartTitle = jsonObject.ChartTitle;
		var chartType  = jsonObject.ChartType;
		var chartSize  = jsonObject.ChartSize;
		var dataSets   = jsonObject.DataSets;
		
		var dataArray = [];
		var dataPointArray = [];
		var labelString = '';
		var b=0;
		for (a = 1; a <= dataSets; a++) {
			for (i = 0; i <= totalData; i++) {
				var label = eval('jsonObject.DataPoints['+i+'].Label'+a);
				var dataPoint = eval('jsonObject.DataPoints['+i+'].Data'+a);
				
				dataPointArray[i] = dataPoint;
				labelString += label;
				
				if (i < totalData) {
					labelString += '|';
				}
			}
			dataArray[b] = dataPointArray;
			b++;
		}		
		*/
		/*
		 * Set up Google Chart wrapper
		 */
		/*
		var g=new GoogleChart();  
		g.init(renderDivVar); 
		g.setChartType(chartType);  
		g.setChartTitle(chartTitle);  
		g.setChartSize(chartSize);  
		g.setChartColors([hexColorArray]);  
		g.setChartData([dataArray[0]]);  
		g.setLabels(labelString);  
		g.drawChart();		
		*/
		
	}
}

var viewTabContent = {
	content0Load : function() {
		
	}
}

Ext.onReady(function() {
	//usersSupportObj.renderUsersGrid();
});